#include<iostream>
using namespace std;
#include<string>
/*
作用：用于从键盘获取数据
关键字：cin
语法：cin >> 变量

*/
int main(){
    //1整型
    int a = 0;
    cout<<"请给整型变量a赋值："<<endl;
    cin>>a;
    cout<<"整型变量a="<<a<<endl;

    //2浮点型
    float f = 3.14f;
    cout<<"请给浮点型变量f赋值："<<endl;
    cin>>f;
    cout<<"浮点型变量f="<<f<<endl;

    //3字符型
    char ch;
    cout<<"请给字符型变量ch赋值"<<endl;
    cin>>ch;
    cout<<"字符型变量ch="<<ch<<endl;

    //4字符串型
    string str = "hello";
    cout<<"请给字符串str赋值"<<endl;
    cin>>str;
    cout<<"字符串str="<<str<<endl;

    //5布尔类型
    bool flag;
    cout<<"请给布尔类型flag赋值"<<endl;
    cin>>flag;
    cout<<"布尔类型flag="<<flag<<endl;//只要非0都为真
    return 0;
}